-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\mdnieman\Dropbox\Mark Research\Published Work\2015\SPPO\PA Final Submission\Simulations\SPPO_MC_PA.log
  log type:  text
 opened on:  11 Jan 2015, 17:35:08

. /*******************************/
> /*****  Mark David Nieman  *****/
> /*****  1/10/2015          *****/
> /*****  Strategic Model, Split-sample Model, Probit  *****/
> /***** DGP: strategic *****/
> /*****  Monte Carlos & Comparisons  *****/
> /*****  Stata 11.2         *****/
> /*******************************/
> #delimit;
delimiter now ;
. clear;

. clear matrix;

. clear mata;

. set memory 4g;

. program drop _all;

. set seed 17;

. /* Structure of game (utilities in parentheses where r_ is player 1 and g_ is player 2). The application is civil war, so we can treat r as rebels, and g as governme
> nt.
>            Player 1 (r)
>             /   \
>     ~Chal  /     \ Chal
>           /       \
>         Det      Player 2 (g)
>          (r_det)       /        \
>                   /      \
>                  /        \
>                 Acq               War
>                (0,0)    (r_war, g_war) */
> 
> /* create a likelihood function for a strategic probit where the first actor's (r) action (chal or 1-chal) is unobservable. This means that while there are three out
> comes (det, acq, war), we can only see if war=0 or war=1. */
>                 #delimit;
delimiter now ;
.                 program define sppo_lf, rclass;
  1.                                                 args lnf r_det r_war g_war;
  2.                                                                         tempvar pun chal ;
  3.                                 quietly gen double `pun' = normal(`g_war'/sqrt(2));
  4.                                                         quietly gen double `chal' = normal((`pun'*`r_war' -`r_det')/(sqrt(`pun'^2+ (1-`pun')^2+1)));
  5.                         quietly replace `lnf' = ln((1-`chal')+(`chal')*(1-`pun')) if $ML_y1==0;
  6.                                                                         quietly replace `lnf' = ln((`chal')*(`pun')) if $ML_y1==1;
  7.                 end;

.                 /* create the split sample probit */
>                 #delimit;
delimiter now ;
.                 program define ssp_lf, rclass;
  1.                                         args lnf sq fight;
  2.                         tempvar sel_in war;
  3.                                 quietly gen double `sel_in' = normal(-`sq');
  4.                                 quietly gen double `war' = normal(`fight');
  5.                         quietly replace `lnf' = ln((1-`sel_in')+(`sel_in'*(1-`war'))) if $ML_y1==0;
  6.                                 quietly replace `lnf' = ln((`sel_in')*(`war')) if $ML_y1==1;
  7.                 end;

.                 #delimit;
delimiter now ;
. /* program to generate y */
> program define mc_strat, rclass;
  1.   syntax, indvars(string);
  2.         use "`indvars'.dta", clear;
  3.         #delimit;
delimiter now ;
.         /* generate 5 normally distributed error terms (private information for each outcome, see Signorino 2003)*/
>         gen double u1 = invnorm(uniform());
  4.         gen double u2 = invnorm(uniform());
  5.         gen double u3 = invnorm(uniform());
  6.         gen double u4 = invnorm(uniform());
  7.         gen double u5 = invnorm(uniform());
  8.         /* generate 3 utilities for Player 1: deterred (status quo), acquiesces, war. Acquiescence is set to 0. */
>         gen double U_R_Det = 1*x1+u1;
  9.         gen double U_R_Acq = u2;
 10.                                                 gen double U_R_War = 1*x2 + 1*c1 + u3;
 11.         /* generate 2 utilities for Player 2: acquiesce and war */
>         gen double U_G_No_War = u4;
 12.         gen double U_G_War = 1*z1 + 1*c1 +u5;
 13.         gen double pi_Pun=normal((U_G_War-U_G_No_War)/sqrt(2));
 14.                         /* calculate the "correct" outcomes contingent on each actor's utility */
>                 /* Rebels Deterred */
>                 gen Det = 0;
 15.                 replace Det =1 if       U_R_Det >= U_R_Acq*(1-pi_Pun) +U_R_War*pi_Pun ;
 16.                 /* Government Acquiesces */
>                 gen Acq = 0;
 17.                 replace Acq =1 if       (U_R_Acq*(1-pi_Pun) +U_R_War*pi_Pun > U_R_Det) & (U_G_No_War >= U_G_War);
 18.                 /* Civil War */
>                 gen War = 0;
 19.                 replace War =1 if       (U_R_Acq*(1-pi_Pun) +U_R_War*pi_Pun > U_R_Det) & (U_G_War > U_G_No_War);
 20.                 sum Acq;
 21.         return scalar Acq_true=r(mean);
 22.                         #delimit;
delimiter now ;
.                                         /* run a traditional probit model to compare results */
>                 gen x1_prime = -x1;
 23.                 probit War x1_prime x2 z1 c1, nocons;
 24.                 return scalar x2_prob=_b[x2];
 25.                 return scalar x2_prob_se=_se[x2];
 26.                                 return scalar x1_prob=_b[x1_prime];
 27.                 return scalar x1_prob_se=_se[x1_prime];
 28.                 return scalar z1_prob=_b[z1];
 29.                 return scalar z1_prob_se=_se[z1];
 30.                 return scalar c1_prob=_b[c1];
 31.                 return scalar c1_prob_se=_se[c1];
 32.                 matrix ll_p = e(ll);
 33.                 #delimit;
delimiter now ;
.                 /* obtain each individual observation's likelihood for use in the Clarke test, as well as other in-sample test statistics (pct correct, pct war corre
> ct, false positive)*/
>                 /* generate likelihood (this can also be recovered from a hand-written probit program, but is computationally intensive and takes a significantly lon
> ger time.) */
>                 /* probit likelihood with Schwartz correction */
>                 gen double lnfj_p = .;
 34.                         replace lnfj_p = ln(normal(-(_b[x1_prime]*x1_prime + _b[z1]*z1 + _b[x2]*x2 + _b[c1]*c1))) if War==0;
 35.                         replace lnfj_p = ln(normal(_b[x1]*x1 + _b[z1]*z1 + _b[x2]*x2 + _b[c1]*c1)) if War==1;
 36.                         replace lnfj_p = lnfj_p*(4/(2*_N))*ln(_N);
 37.                 /* probability of war (probit) */
>                 gen double pr_War_p = normal(_b[x1]*x1 + _b[z1]*z1 + _b[x2]*x2 + _b[c1]*c1);
 38.                 gen p_predict_War = 0;
 39.                                 replace p_predict_War =1 if pr_War_p > .5;
 40.                         /* observations correctly predicted */
>                         gen correct_p = 0;
 41.                                 replace correct_p = 1 if (p_predict_War==1 & War==1) | (p_predict_War==0 & War==0);
 42.                         /* observations correctly predicted as war */
>                         gen correct_war_p = .;
 43.                                 replace correct_war_p = 0 if (p_predict_War==0 & War==1);
 44.                                 replace correct_war_p = 1 if (p_predict_War==1 & War==1);
 45.                         /* observations incorrectly predicted as war*/
>                         gen incorrect_war_p =.;
 46.                                 replace incorrect_war_p = 0 if (p_predict_War==0 & War==0);
 47.                                 replace incorrect_war_p = 1 if (p_predict_War==1 & War==0);
 48.                         /* results */   
>                         sum correct_p;
 49.                                 return scalar correct_pct_p = r(mean);
 50.                         sum correct_war_p;
 51.                                 return scalar correct_war_pct_p = r(mean);
 52.                         sum incorrect_war_p;
 53.                                 return scalar incorrect_war_pct_p = r(mean);
 54.                                                 /* call the strategic probit with partial observability model to estimate the parameters */
>                 #delimit;
delimiter now ;
.                 ml model lf sppo_lf (R_Det:War=x1, nocons) (R_War:War = x2 c1, nocons) (G_War: War= z1 c1, nocons) ;
 55.                 ml maximize, diff;
 56.                 return scalar x1_sppo=[R_Det]_b[x1];
 57.                 return scalar x1_sppo_se=[R_Det]_se[x1];
 58.                                 return scalar x2_sppo=[R_War]_b[x2];
 59.                 return scalar x2_sppo_se=[R_War]_se[x2];
 60.                 return scalar c1a_sppo=[R_War]_b[c1];
 61.                 return scalar c1a_sppo_se=[R_War]_se[c1];
 62.                 return scalar z1_sppo=[G_War]_b[z1];
 63.                 return scalar z1_sppo_se=[G_War]_se[z1];
 64.                 return scalar c1b_sppo=[G_War]_b[c1];
 65.                 return scalar c1b_sppo_se=[G_War]_se[c1];
 66.                 matrix ll_sppo = e(ll);
 67.                 #delimit;
delimiter now ;
.                 /* obtain each individual observation's likelihood for use in the Clarke test, as well as other in-sample test statistics (pct correct, pct war corre
> ct, false positive, correctly predicted acquiesce)*/
>                 /* generate likelihood (this can also be recovered in the lf_sppo program, but is computationally intensive and takes a significantly longer time.) *
> /
>                 /* sppo likelihood with Schwartz correction */          
>                 gen double pun = normal( ([G_War]_b[z1]*z1 + [G_War]_b[c1]*c1) / sqrt(2) );
 68.                 gen double chal = normal( ( pun*([R_War]_b[x2]*x2+[R_War]_b[c1]*c1) - ([R_Det]_b[x1]*x1) ) /(sqrt(pun^2+ (1-pun)^2+1) ));
 69.                 gen double lnfj_sppo = .;
 70.                         replace  lnfj_sppo = ln((1-chal)+(chal)*(1-pun)) if War==0;
 71.                         replace  lnfj_sppo = ln((chal)*(pun)) if War==1;
 72.                         #delimit;
delimiter now ;
.                         replace lnfj_sppo = lnfj_sppo*(5/(2*_N))*ln(_N);
 73.                 #delimit;
delimiter now ;
.                 /* probability of war (sppo) */
>                 gen double pr_War_sppo = pun*chal;
 74.                 gen double pr_Acq_sppo = chal*(1-pun);
 75.                 gen double pr_Det_sppo = 1-chal;
 76.                         gen sppo_predict_War = 0;
 77.                                 replace sppo_predict_War =1 if (pr_War_sppo > pr_Acq_sppo) & (pr_War_sppo > pr_Det_sppo);
 78.                         /* observations correctly predicted */
>                         gen correct_sppo = 0;
 79.                                 replace correct_sppo = 1 if (sppo_predict_War==1 & War==1) | (sppo_predict_War==0 & War==0);
 80.                         /* observations correctly predicted as war */
>                         gen correct_war_sppo = .;
 81.                                 replace correct_war_sppo = 0 if (sppo_predict_War==0 & War==1);
 82.                                 replace correct_war_sppo = 1 if (sppo_predict_War==1 & War==1);
 83.                         /* observations incorrectly predicted as war*/
>                         gen incorrect_war_sppo =.;
 84.                                 replace incorrect_war_sppo = 0 if (sppo_predict_War==0 & War==0);
 85.                                 replace incorrect_war_sppo = 1 if (sppo_predict_War==1 & War==0);
 86.                         /* percent correctly predicted unobserved Y3 (acquiesce) */
>                         gen sppo_predict_acq=0;
 87.                                 replace sppo_predict_acq=  1 if (pr_War_sppo < pr_Acq_sppo) & (pr_Acq_sppo > pr_Det_sppo);
 88.                         gen correct_acq_sppo=.;
 89.                                         replace correct_acq_sppo = 0 if (sppo_predict_acq==0 & Acq==1);
 90.                                 replace correct_acq_sppo = 1 if (sppo_predict_acq==1 & Acq==1);
 91.                         /* results*/
>                         sum correct_sppo;
 92.                                 return scalar correct_pct_sppo = r(mean);
 93.                         sum correct_war_sppo;
 94.                                 return scalar correct_war_pct_sppo = r(mean);
 95.                         sum incorrect_war_sppo;
 96.                                 return scalar incorrect_war_pct_sppo = r(mean);
 97.                         sum correct_acq_sppo;
 98.                                 return scalar correct_acq_sppo=r(mean);
 99.                                                                                 /* call the split-sample probit model to estimate the parameters */
>                 #delimit;
delimiter now ;
.                 gen c1_prime = -c1;
100.                 ml model lf ssp_lf (SQ:War=x1 c1_prime, nocons) (War:War = x2 z1 c1, nocons);
101.                 ml maximize, diff;
102.                         return scalar x1_ssp=[SQ]_b[x1];
103.                 return scalar x1_ssp_se=[SQ]_se[x1];
104.                                 return scalar x2_ssp=[War]_b[x2];
105.                 return scalar x2_ssp_se=[War]_se[x2];
106.                 return scalar z1_ssp=[War]_b[z1];
107.                 return scalar z1_ssp_se=[War]_se[z1];
108.                 return scalar c1a_ssp=[SQ]_b[c1_prime];
109.                 return scalar c1a_ssp_se=[SQ]_se[c1_prime];
110.                 return scalar c1b_ssp=[War]_b[c1];
111.                 return scalar c1b_ssp_se=[War]_se[c1];
112.                 matrix ll_ssp = e(ll);
113.                 /* obtain each individual observation's likelihood for use in the Clarke test, as well as other in-sample test statistics (pct correct, pct war co
> rrect, false positive)*/
>                 /* generate likelihood (this can also be recovered in the lf_ssp program, but is computationally intensive and takes a significantly longer time.) */
>                 /* ssp likelihood with Schwartz correction */
>                 #delimit;
delimiter now ;
.                 gen double sel_in = normal( -([SQ]_b[x1]*x1 + [SQ]_b[c1_prime]*c1_prime) );
114.                 gen double confl = normal([War]_b[x2]*x2+ [War]_b[z1]*z1+ [War]_b[c1]*c1);
115.                 #delimit;
delimiter now ;
.                 gen double lnfj_ssp = .;
116.                         replace  lnfj_ssp = ln((1-sel_in)+(sel_in*(1-confl))) if War==0;
117.         ;
.                         replace  lnfj_ssp = ln((sel_in)*(confl)) if War==1;
118.                         replace lnfj_ssp = lnfj_ssp*(5/(2*_N))*ln(_N);
119.                 #delimit;
delimiter now ;
.                 /* probability of war (ssp) */
>                 gen double pr_War_ssp = sel_in*confl;
120.                         gen ssp_predict_War = 0;
121.                                 replace ssp_predict_War =1 if pr_War_sppo > .5;
122.                         /* observations correctly predicted */  
>                         gen correct_ssp = 0;
123.                                 replace correct_ssp = 1 if (ssp_predict_War==1 & War==1) | (ssp_predict_War==0 & War==0);
124.                         /* observations correctly predicted as war */
>                         gen correct_war_ssp = .;
125.                                 replace correct_war_ssp = 0 if (ssp_predict_War==0 & War==1);
126.                                 replace correct_war_ssp = 1 if (ssp_predict_War==1 & War==1);
127.                         /* observations incorrectly predicted as war*/
>                         gen incorrect_war_ssp =.;
128.                                 replace incorrect_war_ssp = 0 if (ssp_predict_War==0 & War==0);
129.                                 replace incorrect_war_ssp = 1 if (ssp_predict_War==1 & War==0);
130.                                 /* results */
>                         sum correct_ssp;
131.                                 return scalar correct_pct_ssp = r(mean);
132.                         sum correct_war_ssp;
133.                                 return scalar correct_war_pct_ssp = r(mean);
134.                         sum incorrect_war_ssp;
135.                                 return scalar incorrect_war_pct_ssp = r(mean);
136.                                                                                                                                 /* Use Clarke's non-parametric app
> roach to compare each observation's likelihood: SPPO vs SSP*/
>                 signtest lnfj_sppo=lnfj_ssp;
137.                 return scalar Clark_sppo_ssp_pos = r(N_pos);
138.                 return scalar Clark_sppo_ssp_pos_1s = r(p_pos);
139.                 return scalar Clark_sppo_ssp_neg_1s = r(p_neg);
140.                 return scalar Clark_sppo_ssp_eq_2s = r(p_2);
141.                 /* Use Clark's non-parametric approach to compare each observation's likelihood: SPPO vs probit*/
>                 signtest lnfj_sppo=lnfj_p;
142.                 return scalar Clark_sppo_p_pos = r(N_pos);
143.                 return scalar Clark_sppo_p_pos_1s = r(p_pos);
144.                 return scalar Clark_sppo_p_neg_1s = r(p_neg);
145.                 return scalar Clark_sppo_p_eq_2s = r(p_2);
146.                                                 /* Voung Test: SPPO vs probit*/
>                 svmat ll_p;
147.                 svmat ll_sppo;
148.                 gen num_V_sppo_p = ll_sppo1 - ll_p1 + ((5/2)*ln(_N)-(4/2)*ln(_N));
149.                 sum num_V_sppo_p;
150.                         return scalar num_V_sppo_p = r(mean);
151.                 egen denom1_V_sppo_p = mean((lnfj_sppo/lnfj_p)^2);
152.                 gen denom2_V_sppo_p = sqrt(denom1_V_sppo_p);
153.                 sum denom2_V_sppo_p;
154.                         return scalar denom2_V_sppo_p = r(mean);
155.                 gen Voung_sppo_p = num_V_sppo_p/denom2_V_sppo_p;
156.                 sum Voung_sppo_p;
157.                         return scalar Voung_sppo_p = r(mean);
158.                 /* Voung Test: SPPO vs SSP*/
>                 svmat ll_ssp;
159.                 gen num_V_sppo_ssp = ll_sppo1 - ll_ssp1 + ((5/2)*ln(_N)-(5/2)*ln(_N));
160.                 sum num_V_sppo_ssp;
161.                         return scalar num_V_sppo_ssp = r(mean);
162.                 egen denom1_V_sppo_ssp = mean((lnfj_sppo/lnfj_ssp)^2);
163.                 gen denom2_V_sppo_ssp = sqrt(denom1_V_sppo_ssp);
164.                 sum denom2_V_sppo_ssp;
165.                         return scalar denom2_V_sppo_ssp = r(mean);
166.                 gen Voung_sppo_ssp = num_V_sppo_ssp/denom2_V_sppo_ssp;
167.                 sum Voung_sppo_ssp;
168.                         return scalar Voung_sppo_ssp = r(mean);
169.                                                                 /* Robustness Check */  
>                 /* call the strategic probit with partial observability model to estimate the parameters when model misspecified */
>                 #delimit;
delimiter now ;
.                 ml model lf sppo_lf (R_Det:War=x1 x2, nocons) (R_War:War = x2 c1 x4, nocons) (G_War: War= z1 c1 x2, nocons) ;
170.                 ml maximize, diff;
171.                 return scalar x1_sppo_mis=[R_Det]_b[x1];
172.                 return scalar x1_sppo_se_mis=[R_Det]_se[x1];
173.                 return scalar x3_sppo_mis=[R_Det]_b[x2];
174.                 return scalar x3_sppo_se_mis=[R_Det]_se[x2];
175.                                 return scalar x2_sppo_mis=[R_War]_b[x2];
176.                 return scalar x2_sppo_se_mis=[R_War]_se[x2];
177.                 return scalar c1_sppo_mis=[R_War]_b[c1];
178.                 return scalar c1_sppo_se_mis=[R_War]_se[c1];
179.                 return scalar x4_sppo_mis=[R_War]_b[x4];
180.                 return scalar x4_sppo_se_mis=[R_War]_se[x4];
181.                 return scalar g_z1_sppo_mis=[G_War]_b[z1];
182.                 return scalar g_z1_sppo_se_mis=[G_War]_se[z1];
183.                 return scalar g_c1_sppo_mis=[G_War]_b[c1];
184.                 return scalar g_c1_sppo_se_mis=[G_War]_se[c1];
185.                 return scalar g_x4_sppo_mis=[G_War]_b[x2];
186.                 return scalar g_x4_sppo_se_mis=[G_War]_se[x2];
187.                 #delimit;
delimiter now ;
.                 /* obtain each individual observation's likelihood for use in the Clarke test, as well as other in-sample test statistics (pct correct, pct war corre
> ct, false positive, correctly predicted acquiesce)*/
>                 /* generate likelihood (this can also be recovered in the lf_sppo program, but is computationally intensive and takes a significantly longer time.) *
> /
>                 /* sppo likelihood  */  
>                 gen double pun_mis = normal(([G_War]_b[z1]*z1 + [G_War]_b[c1]*c1 + [G_War]_b[x2]*x2)/sqrt(2));
188.                 gen double chal_mis = normal((pun*([R_War]_b[x2]*x2 + [R_War]_b[c1]*c1 + [R_War]_b[x4]*x4) -([R_Det]_b[x1]*x1 + [R_Det]_b[x2]*x2))/(sqrt(pun^2+ (1
> -pun)^2+1)));
189.                 gen double lnfj_sppo_mis = .;
190.                         replace  lnfj_sppo_mis = ln((1-chal_mis)+(chal_mis)*(1-pun_mis)) if War==0;
191.                         replace  lnfj_sppo_mis = ln((chal_mis)*(pun_mis)) if War==1;
192.                 #delimit;
delimiter now ;
.                 /* probability of war (sppo) */
>                 gen double pr_War_sppo_mis = pun_mis*chal_mis;
193.                 gen double pr_Acq_sppo_mis = chal_mis*(1-pun_mis);
194.                 gen double pr_Det_sppo_mis = 1-chal_mis;
195.                         gen sppo_predict_War_mis = 0;
196.                                 replace sppo_predict_War_mis =1 if (pr_War_sppo_mis > pr_Acq_sppo_mis) & (pr_War_sppo_mis > pr_Det_sppo_mis);
197.                         /* observations correctly predicted */
>                         gen correct_sppo_mis = 0;
198.                                 replace correct_sppo_mis = 1 if (sppo_predict_War_mis==1 & War==1) | (sppo_predict_War_mis==0 & War==0);
199.                         /* observations correctly predicted as war */
>                         gen correct_war_sppo_mis = .;
200.                                 replace correct_war_sppo_mis = 0 if (sppo_predict_War_mis==0 & War==1);
201.                                 replace correct_war_sppo_mis = 1 if (sppo_predict_War_mis==1 & War==1);
202.                         /* observations incorrectly predicted as war*/
>                         gen incorrect_war_sppo_mis =.;
203.                                 replace incorrect_war_sppo_mis = 0 if (sppo_predict_War_mis==0 & War==0);
204.                                 replace incorrect_war_sppo_mis = 1 if (sppo_predict_War_mis==1 & War==0);
205.                         /* percent correctly predicted unobserved Y3 (acquiesce) */
>                         gen sppo_predict_acq_mis=0;
206.                                 replace sppo_predict_acq_mis=  1 if (pr_War_sppo_mis < pr_Acq_sppo_mis) & (pr_Acq_sppo_mis > pr_Det_sppo_mis);
207.                         gen correct_acq_sppo_mis=.;
208.                                         replace correct_acq_sppo_mis = 0 if (sppo_predict_acq_mis==0 & Acq==1);
209.                                 replace correct_acq_sppo_mis = 1 if (sppo_predict_acq_mis==1 & Acq==1);
210.                         /* results */
>                         sum correct_sppo_mis;
211.                                 return scalar correct_pct_sppo_mis = r(mean);
212.                         sum correct_war_sppo_mis;
213.                                 return scalar correct_war_pct_sppo_mis = r(mean);
214.                         sum incorrect_war_sppo_mis;
215.                                 return scalar incorrect_war_pct_sppo_mis = r(mean);
216.                         sum correct_acq_sppo_mis;
217.                                 return scalar correct_acq_sppo_mis=r(mean);
218.                                                 end;

.         #delimit;
delimiter now ;
.         clear;

.                 /* generate independent variables. */
>         drawnorm z1 x1 x2 c1 x3 x4, n(5000) ;
(obs 5000)

. #delimit;
delimiter now ;
. save indvars.dta, replace;
file indvars.dta saved

. simulate 
>         x2_prob=r(x2_prob) x2_prob_se=r(x2_prob_se)
>         x1_prob=r(x1_prob) x1_prob_se=r(x1_prob_se)
>         z1_prob=r(z1_prob) z1_prob_se=r(z1_prob_se)
>         c1_prob=r(c1_prob) c1_prob_se=r(c1_prob_se)
>         
>         
>         R_Det_x1=r(x1_sppo) R_Det_x1_se=r(x1_sppo_se)
>         R_War_x2=r(x2_sppo) R_War_x2_se=r(x2_sppo_se)
>         R_War_c1=r(c1a_sppo) R_War_c1_se=r(c1a_sppo_se)
>         G_War_z1=r(z1_sppo) G_War_z1_se=r(z1_sppo_se)
>         G_War_c1=r(c1b_sppo) G_War_c1_se=r(c1b_sppo_se)
>         
>         
>         x1_ssp=r(x1_ssp) x1_ssp_se=r(x1_ssp_se)
>         x2_ssp=r(x2_ssp) x2_ssp_se=r(x2_ssp_se)
>         z1_ssp=r(z1_ssp) z1_ssp_se=r(z1_ssp_se)
>         c1a_ssp=r(c1a_ssp) c1a_ssp_se=r(c1a_ssp_se)
>         c1b_ssp=r(c1b_ssp) c1b_ssp_se=r(c1b_ssp_se)
>         
>         correct_pct_p = r(correct_pct_p)
>         correct_war_pct_p = r(correct_war_pct_p)
>         incorrect_war_pct_p=r(incorrect_war_pct_p)
>         correct_pct_sppo = r(correct_pct_sppo)
>         correct_war_pct_sppo = r(correct_war_pct_sppo)
>         incorrect_war_pct_sppo = r(incorrect_war_pct_sppo)
>         correct_pct_ssp = r(correct_pct_ssp)
>         correct_war_pct_ssp = r(correct_war_pct_ssp)
>         incorrect_war_pct_ssp = r(incorrect_war_pct_ssp)
>         
>         /*Predicting Unobserved Outcome Acquiesce*/     
>         correct_acq_sppo=r(correct_acq_sppo)
>         Acq_true=r(Acq_true)
>         
>         Clark_sppo_ssp_pos = r(Clark_sppo_ssp_pos)
>         Clark_sppo_ssp_pos_1s = r(Clark_sppo_ssp_pos_1s)
>         Clark_sppo_ssp_neg_1s = r(Clark_sppo_ssp_neg_1s)
>         Clark_sppo_ssp_eq_2s = r(Clark_sppo_ssp_eq_2s)
>         Clark_sppo_p_pos = r(Clark_sppo_p_pos)
>         Clark_sppo_p_pos_1s = r(Clark_sppo_p_pos_1s)
>         Clark_sppo_p_neg_1s = r(Clark_sppo_p_neg_1s)
>         Clark_sppo_p_eq_2s = r(Clark_sppo_p_eq_2s)
>         num_V_sppo_ssp = r(num_V_sppo_ssp)
>         denom2_V_sppo_ssp = r(denom2_V_sppo_ssp)
>         num_V_sppo_p = r(num_V_sppo_p)
>         denom2_V_sppo_p = r(denom2_V_sppo_p)
>         Voung_sppo_ssp = r(Voung_sppo_ssp)
>         Voung_sppo_p = r(Voung_sppo_p)
>         
>         R_Det_x1_mis=r(x1_sppo_mis) R_Det_x1_se_mis=r(x1_sppo_se_mis)
>         R_Det_x3_mis=r(x3_sppo_mis) R_Det_x3_se_mis=r(x3_sppo_se_mis)
>         R_War_x2_mis=r(x2_sppo_mis) R_War_x2_se_mis=r(x2_sppo_se_mis)
>         R_War_c1_mis=r(c1_sppo_mis) R_War_c1_se_mis=r(c1_sppo_se_mis)
>         R_War_x4_mis=r(x4_sppo_mis) R_War_x4_se_mis=r(x4_sppo_se_mis)
>         G_War_z1_mis=r(g_z1_sppo_mis) G_War_z1_se_mis=r(g_z1_sppo_se_mis)
>         G_War_c1_mis=r(g_c1_sppo_mis) G_War_c1_se_mis=r(g_c1_sppo_se_mis)
>         G_War_x4_mis=r(g_x4_sppo_mis) G_War_x4_se_mis=r(g_x4_sppo_se_mis) 
>         
>         correct_pct_sppo_mis = r(correct_pct_sppo_mis)
>         correct_war_pct_sppo_mis = r(correct_war_pct_sppo_mis)
>         incorrect_war_pct_sppo_mis = r(incorrect_war_pct_sppo_mis)
>         correct_acq_sppo_mis = r(correct_acq_sppo_mis)
>         ,
>         
>         reps(2000): 
>         mc_strat, indvars(indvars) ;

         command:  mc_strat, indvars(indvars)
         x2_prob:  r(x2_prob)
      x2_prob_se:  r(x2_prob_se)
         x1_prob:  r(x1_prob)
      x1_prob_se:  r(x1_prob_se)
         z1_prob:  r(z1_prob)
      z1_prob_se:  r(z1_prob_se)
         c1_prob:  r(c1_prob)
      c1_prob_se:  r(c1_prob_se)
        R_Det_x1:  r(x1_sppo)
     R_Det_x1_se:  r(x1_sppo_se)
        R_War_x2:  r(x2_sppo)
     R_War_x2_se:  r(x2_sppo_se)
        R_War_c1:  r(c1a_sppo)
     R_War_c1_se:  r(c1a_sppo_se)
        G_War_z1:  r(z1_sppo)
     G_War_z1_se:  r(z1_sppo_se)
        G_War_c1:  r(c1b_sppo)
     G_War_c1_se:  r(c1b_sppo_se)
          x1_ssp:  r(x1_ssp)
       x1_ssp_se:  r(x1_ssp_se)
          x2_ssp:  r(x2_ssp)
       x2_ssp_se:  r(x2_ssp_se)
          z1_ssp:  r(z1_ssp)
       z1_ssp_se:  r(z1_ssp_se)
         c1a_ssp:  r(c1a_ssp)
      c1a_ssp_se:  r(c1a_ssp_se)
         c1b_ssp:  r(c1b_ssp)
      c1b_ssp_se:  r(c1b_ssp_se)
   correct_pct_p:  r(correct_pct_p)
correct_war_pc~p:  r(correct_war_pct_p)
incorrect_war~_p:  r(incorrect_war_pct_p)
correct_pct_sppo:  r(correct_pct_sppo)
correct_war_pc~o:  r(correct_war_pct_sppo)
incorrect_war_~o:  r(incorrect_war_pct_sppo)
 correct_pct_ssp:  r(correct_pct_ssp)
correct_war_pc~p:  r(correct_war_pct_ssp)
incorrect_war~sp:  r(incorrect_war_pct_ssp)
correct_acq_sppo:  r(correct_acq_sppo)
        Acq_true:  r(Acq_true)
Clark_sppo_ssp~s:  r(Clark_sppo_ssp_pos)
Clark_sppo_ss~1s:  r(Clark_sppo_ssp_pos_1s)
Clark_sppo_ss~1s:  r(Clark_sppo_ssp_neg_1s)
Clark_sppo_ss~2s:  r(Clark_sppo_ssp_eq_2s)
Clark_sppo_p_pos:  r(Clark_sppo_p_pos)
Clark_sppo_p_~1s:  r(Clark_sppo_p_pos_1s)
Clark_sppo_p_~1s:  r(Clark_sppo_p_neg_1s)
Clark_sppo_p_~2s:  r(Clark_sppo_p_eq_2s)
  num_V_sppo_ssp:  r(num_V_sppo_ssp)
denom2_V_sppo~sp:  r(denom2_V_sppo_ssp)
    num_V_sppo_p:  r(num_V_sppo_p)
 denom2_V_sppo_p:  r(denom2_V_sppo_p)
  Voung_sppo_ssp:  r(Voung_sppo_ssp)
    Voung_sppo_p:  r(Voung_sppo_p)
    R_Det_x1_mis:  r(x1_sppo_mis)
 R_Det_x1_se_mis:  r(x1_sppo_se_mis)
    R_Det_x3_mis:  r(x3_sppo_mis)
 R_Det_x3_se_mis:  r(x3_sppo_se_mis)
    R_War_x2_mis:  r(x2_sppo_mis)
 R_War_x2_se_mis:  r(x2_sppo_se_mis)
    R_War_c1_mis:  r(c1_sppo_mis)
 R_War_c1_se_mis:  r(c1_sppo_se_mis)
    R_War_x4_mis:  r(x4_sppo_mis)
 R_War_x4_se_mis:  r(x4_sppo_se_mis)
    G_War_z1_mis:  r(g_z1_sppo_mis)
 G_War_z1_se_mis:  r(g_z1_sppo_se_mis)
    G_War_c1_mis:  r(g_c1_sppo_mis)
 G_War_c1_se_mis:  r(g_c1_sppo_se_mis)
    G_War_x4_mis:  r(g_x4_sppo_mis)
 G_War_x4_se_mis:  r(g_x4_sppo_se_mis)
correct_pct_sp~s:  r(correct_pct_sppo_mis)
correct_war_pc~s:  r(correct_war_pct_sppo_mis)
incorrect_war_~s:  r(incorrect_war_pct_sppo_mis)
correct_acq_sp~s:  r(correct_acq_sppo_mis)

Simulations (2000)
----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 
..................................................    50
..................................................   100
..................................................   150
..................................................   200
..................................................   250
..................................................   300
..................................................   350
..................................................   400
..................................................   450
..................................................   500
..................................................   550
..................................................   600
..................................................   650
..................................................   700
..................................................   750
..................................................   800
..................................................   850
..................................................   900
..................................................   950
..................................................  1000
..................................................  1050
..................................................  1100
..................................................  1150
..................................................  1200
..................................................  1250
..................................................  1300
..................................................  1350
..................................................  1400
..................................................  1450
..................................................  1500
..................................................  1550
..................................................  1600
..................................................  1650
..................................................  1700
..................................................  1750
..................................................  1800
..................................................  1850
..................................................  1900
..................................................  1950
..................................................  2000

.                 /* see results and compare to the "real" values  */
>         sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     x2_prob |      2000     .250884    .0166132   .1987428   .3222765
  x2_prob_se |      2000    .0197954    .0001377   .0193709   .0203726
     x1_prob |      2000    .3256655    .0169666   .2765934   .3839378
  x1_prob_se |      2000    .0200851    .0001521   .0195836    .020619
     z1_prob |      2000    .3405083    .0174752   .2793724   .4081308
-------------+--------------------------------------------------------
  z1_prob_se |      2000    .0206641     .000164   .0201362   .0213323
     c1_prob |      2000    .5703301    .0190611   .5113412   .6496484
  c1_prob_se |      2000    .0215359    .0002457   .0206989    .022498
    R_Det_x1 |      2000    .9717174    .0581907   .7832989   1.165038
 R_Det_x1_se |      2000    .0575516    .0024448   .0507184   .0662309
-------------+--------------------------------------------------------
    R_War_x2 |      2000    1.077598      .08603   .8118813    1.36563
 R_War_x2_se |      2000    .0827377    .0052279   .0694622   .1013344
    R_War_c1 |      2000     .986843    .0991304   .7021284   1.333022
 R_War_c1_se |      2000    .0901584    .0094974   .0693072    .144576
    G_War_z1 |      2000    .9823653    .0608234    .773626   1.210915
-------------+--------------------------------------------------------
 G_War_z1_se |      2000    .0585159    .0024047   .0516895   .0688937
    G_War_c1 |      2000     1.08711    .0777442   .8175686   1.354009
 G_War_c1_se |      2000    .0691331    .0042897   .0561914   .0914405
      x1_ssp |      2000    .6531379    .0402241   .5298132    .776253
   x1_ssp_se |      2000    .0406256     .001622    .035954   .0475261
-------------+--------------------------------------------------------
      x2_ssp |      2000    .4329705    .0368474   .3291328   .5851983
   x2_ssp_se |      2000    .0373702    .0012075   .0336698     .04379
      z1_ssp |      2000     .694257     .043799   .5465716   .8528058
   z1_ssp_se |      2000    .0434532    .0018698   .0384078   .0504703
     c1a_ssp |      2000    .6488635     .055923   .4495035   .8689222
-------------+--------------------------------------------------------
  c1a_ssp_se |      2000    .0558762    .0043802   .0449148   .0862451
     c1b_ssp |      2000    .6096733    .0553578   .3854599   .8264149
  c1b_ssp_se |      2000    .0550853    .0047653   .0426699    .081462
correct_p~_p |      2000    .6375321    .0080132      .6074      .6612
correct_w~_p |      2000     .749824    .0137249   .7038596   .7934936
-------------+--------------------------------------------------------
incorrect~_p |      2000    .4075954    .0059025   .3897436   .4302326
correct_pc~o |      2000    .8020139    .0049573      .7876      .8196
correct_wa~o |      2000    .6478993     .012019   .6089699   .6901906
incorrect_~o |      2000    .1360013    .0036642   .1228611   .1478285
correct_p~sp |      2000    .8085717    .0050149       .788      .8248
-------------+--------------------------------------------------------
correct_w~sp |      2000    .5616974    .0141218   .5146358   .6055046
incorrect~sp |      2000    .0921487     .002823      .0821   .1014533
correct_ac~o |      2000    .4131667    .0132118   .3641525   .4582651
    Acq_true |      2000    .2425553    .0054741      .2222      .2612
Clark~sp_pos |      2000    2524.703    69.49487       2304       2752
-------------+--------------------------------------------------------
Cl~sp_pos_1s |      2000    .3795245    .3689366   5.42e-13          1
Cl~sp_neg_1s |      2000    .6253727    .3677658   1.58e-08          1
Cla~sp_eq_2s |      2000    .2898909    .3067946   1.08e-12          1
Clark~_p_pos |      2000    3891.218    34.23841       3770       4019
Cl~_p_pos_1s |      2000           0           0          0          0
-------------+--------------------------------------------------------
Cl~_p_neg_1s |      2000           1           0          1          1
Cla~_p_eq_2s |      2000           0           0          0          0
num_V_spp~sp |      2000    48.01551    11.80461   6.432861    87.2439
denom2_V_~sp |      2000    3.755504     1.44922   1.742369   23.39154
num_V_sppo_p |      2000    710.0548     31.3128   597.4671   816.2426
-------------+--------------------------------------------------------
denom2_V_~_p |      2000    11.22285    13.84571   2.082333   101.5528
Voung_spp~sp |      2000     14.5073    6.266077    .754537    42.3472
Voung_sppo_p |      2000    171.3369    101.7538   6.733881   352.4683
R_Det_x1_mis |      2000    .9724378    .0586992   .7795733   1.154315
R_Det_x1_s~s |      2000     .057444    .0024031   .0507045   .0664533
-------------+--------------------------------------------------------
R_Det_x3_mis |      2000      -.6715    .1956849  -1.350712  -.0850742
R_Det_x3_s~s |      2000    .1954499    .0133038    .156764    .256897
R_War_x2_mis |      2000    .1983575    .2471383  -.6998588   1.000333
R_War_x2_s~s |      2000    .2474713    .0140247   .2053239   .3047401
R_War_c1_mis |      2000    .9155472    .0897132   .6393928   1.259382
-------------+--------------------------------------------------------
R_War_c1_s~s |      2000    .0841558    .0081279   .0662161    .123061
R_War_x4_mis |      2000    .0032953    .0641803  -.2356166   .2068993
R_War_x4_s~s |      2000    .0638129     .002182    .057722   .0710265
G_War_z1_mis |      2000     .998105     .060125   .8038591   1.224528
G_War_z1_s~s |      2000    .0590159    .0023796   .0525109   .0692116
-------------+--------------------------------------------------------
G_War_c1_mis |      2000    1.146067    .0754935   .9067123   1.408263
G_War_c1_s~s |      2000    .0695693    .0038946    .058621   .0884811
G_War_x4_mis |      2000   -.0434007    .0656705  -.2563673   .1973439
G_War_x4_s~s |      2000    .0632317    .0036366   .0535377   .0803249
correct_pc~s |      2000    .8021225    .0049428      .7866      .8168
-------------+--------------------------------------------------------
correct_wa~s |      2000    .6474979     .012307   .6045865   .6842476
incorrect_~s |      2000    .1357085    .0037422    .123307   .1482921
correct_ac~s |      2000    .4265257     .013004   .3836172   .4747307

.          /*generate root mean standard error for each parameter */
> #delimit;
delimiter now ;
. gen rmse_x2_sppo = sqrt((R_War_x2 - 1)^2 + (R_War_x2_se));

.  gen rmse_x2_p = sqrt((x2_prob - 1)^2 + (x2_prob_se));

. gen rmse_x2_ssp = sqrt((x2_ssp - 1)^2 + (x2_ssp_se));

. gen rmse_z1_sppo = sqrt((G_War_z1 - 1)^2 + (G_War_z1_se));

.  gen rmse_z1_p = sqrt((z1_prob - 1)^2 + (z1_prob_se));

. gen rmse_z1_ssp = sqrt((z1_ssp - 1)^2 + (z1_ssp_se));

. gen rmse_x1_sppo = sqrt((R_Det_x1 - 1)^2 + (R_Det_x1_se));

.  gen rmse_x1_p = sqrt((x1_prob - 1)^2 + (x1_prob_se));

. gen rmse_x1_ssp = sqrt((x1_ssp - 1)^2 + (x1_ssp_se));

. gen rmse_c1a_p = sqrt((c1_prob - 1)^2 + (c1_prob_se));

. gen rmse_c1a_ssp = sqrt((c1a_ssp - 1)^2 + (c1a_ssp_se));

. gen rmse_c1a_sppo = sqrt((R_War_c1 - 1)^2 + (R_War_c1_se));

. gen rmse_c1b_p = sqrt((c1_prob - 1)^2 + (c1_prob_se));

. gen rmse_c1b_ssp = sqrt((c1b_ssp - 1)^2 + (c1b_ssp_se));

. gen rmse_c1b_sppo = sqrt((G_War_c1 - 1)^2 + (G_War_c1_se));

. sum rmse_x1_sppo rmse_x1_p rmse_x1_ssp rmse_z1_sppo rmse_z1_p rmse_z1_ssp 
>         rmse_x2_sppo rmse_x2_p rmse_x2_ssp rmse_c1a_p rmse_c1a_ssp rmse_c1a_sppo
>         rmse_c1b_p rmse_c1b_ssp rmse_c1b_sppo;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
rmse_x1_sppo |      2000    .2482823     .009586   .2333459   .3133608
   rmse_x1_p |      2000    .6890771    .0165123   .6325258   .7369703
 rmse_x1_ssp |      2000    .4018294    .0330123   .3092832   .5083912
rmse_z1_sppo |      2000    .2498283    .0105065   .2343606   .3367179
   rmse_z1_p |      2000    .6749895    .0169711    .609624   .7345213
-------------+--------------------------------------------------------
 rmse_z1_ssp |      2000    .3710785    .0339218   .2632973   .4943607
rmse_x2_sppo |      2000    .3084286    .0320784   .2662106   .4812143
   rmse_x2_p |      2000    .7622216    .0162598   .6925747   .8133001
 rmse_x2_ssp |      2000    .5992361    .0341518    .462116   .6960421
  rmse_c1a_p |      2000    .4540924     .017764   .3811091    .509398
-------------+--------------------------------------------------------
rmse_c1a_ssp |      2000    .4247517    .0434256   .2839776   .5946409
rmse_c1a_s~o |      2000    .3154255    .0257016   .2746618   .5032967
  rmse_c1b_p |      2000    .4540924     .017764   .3811091    .509398
rmse_c1b_ssp |      2000    .4566966     .043958    .318056   .6508636
rmse_c1b_s~o |      2000      .28615    .0296807   .2434351    .463293

. save indvars, replace;
file indvars.dta saved

. #delimit;
delimiter now ;
. use indvars, clear;
(simulate: mc_strat)

. /* graph the betas */
> #delimit;
delimiter now ;
. twoway kdensity x1_prob, scheme(s1color) color(gs5) lwidth(medthick) lpattern(shortdash)
>         || kdensity x1_ssp, color(gs9) lwidth(medthin) lpattern(longdash_dot)
>         || kdensity R_Det_x1, color(black) lwidth(medthick)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title(X_11 B_11)
>         legend(label(1 "Traditional Probit") label(2 "Split-Sample Probit") label(3 "Censored Strategic Probit"))
>         ylabel(0 "0" 15 "15" 30 "30");

.         graph save Strat_x1_compare, replace;
(note: file Strat_x1_compare.gph not found)
(file Strat_x1_compare.gph saved)

.         twoway kdensity x2_prob, scheme(s1color) color(gs5) lwidth(medthick) lpattern(shortdash)
> || kdensity x2_ssp, color(gs9) lwidth(medthin) lpattern(longdash_dot)
> || kdensity R_War_x2, color(black) lwidth(medthick)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title(X_14 B_14)
>         legend(label(1 "Traditional Probit") label(2 "Split-Sample Probit") label(3 "Censored Strategic Probit"))
>         ylabel(0 "0" 15 "15" 30 "30");

.         graph save Strat_x2_compare, replace;
(note: file Strat_x2_compare.gph not found)
(file Strat_x2_compare.gph saved)

.         #delimit;
delimiter now ;
. twoway kdensity z1_prob, scheme(s1color) color(gs5) lwidth(medthick) lpattern(shortdash)
> || kdensity z1_ssp, color(gs9) lwidth(medthin) lpattern(longdash_dot)
> || kdensity G_War_z1, color(black) lwidth(medthick)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title(X_24 B_24)
>         legend(label(1 "Traditional Probit") label(2 "Split-Sample Probit") label(3 "Strategic Probit w/ Partial Observability"))
>         legend(off) ylabel(0 "0" 15 "15" 30 "30");

.         graph save Strat_z1_compare, replace;
(note: file Strat_z1_compare.gph not found)
(file Strat_z1_compare.gph saved)

. #delimit;
delimiter now ;
. twoway  kdensity c1a_ssp, scheme(s1color) color(gs9) lwidth(medthin) lpattern(longdash_dot)
> || kdensity R_War_c1, color(black) lwidth(medthick)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("X_C B_14C")
>         /*legend(label(1 "Traditional Probit") label(2 "Split-Sample Probit") label(3 "Censored Strategic Probit"))*/
>         legend(off) ylabel(0 "0" 15 "15" 30 "30");

.         graph save Strat_c1a_compare, replace;
(note: file Strat_c1a_compare.gph not found)
(file Strat_c1a_compare.gph saved)

.                 #delimit;
delimiter now ;
. twoway kdensity c1_prob, scheme(s1color) color(gs5) lwidth(medthick) lpattern(shortdash)
> || kdensity c1b_ssp, color(gs9) lwidth(medthin) lpattern(longdash_dot)
> || kdensity G_War_c1, color(black) lwidth(medthick)
>         xtitle("") xline(1, lcolor(gs8) lpattern(dash)) title("X_C B_24C")
>         legend(label(1 "Probit") label(2 "SSP") label(3 "SPwPO"))
>         legend(off) ylabel(0 "0" 15 "15" 30 "30");

.         graph save Strat_c1b_compare, replace;
(note: file Strat_c1b_compare.gph not found)
(file Strat_c1b_compare.gph saved)

.                 #delimit;
delimiter now ;
. grc1leg Strat_x1_compare.gph Strat_x2_compare.gph Strat_c1a_compare.gph Strat_z1_compare.gph Strat_c1b_compare.gph,
>         scheme(s1color) ycommon xcommon col(3) holes(4)
>         title("Comparison of Estimated Coefficients")
>         l1title("Kernel Density")
>         leg(Strat_z1_compare.gph)
>         b1title("Coefficient") imargin(tiny)
>         note("Note: Dashed verticle line represents the equation's true coefficient. Results of 2000 simulations with 5000" 
>                  "observations each. B_ij represents the estimated coeffient for regressor X_ij, where i is the player and"
>                  "j is the outcome. X_C is a common regressor that appears in each player's utility. Because the traditional"
>                  "probit is a single equation model, it estimates only one parameter for X_C, which is displayed in X_C B_24C.");

.                 graph save Strat_Coef_compare, replace asis;
(note: file Strat_Coef_compare.gph not found)
file Strat_Coef_compare.gph saved

.                 graph export Strat_Coef_compare.eps, replace;
(note: file Strat_Coef_compare.eps not found)
(file Strat_Coef_compare.eps written in EPS format)

. 
end of do-file

. exit, clear
